package com.power.sifa.supervise.dao;

import com.power.sifa.supervise.model.Apl_feedbackdoc;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.query.Param;

import javax.transaction.Transactional;
import java.io.Serializable;
import java.util.List;

/**
 * 处理反馈材料 持久层(hibernate)
 */

public interface Apl_feedbackdocDao extends JpaRepository<Apl_feedbackdoc, Serializable>, JpaSpecificationExecutor<Apl_feedbackdoc>, Repository<Apl_feedbackdoc, Serializable>, Apl_feedbackdocDaoCustom<Apl_feedbackdoc, Serializable> {

   @Modifying
   @Transactional
   @Query("delete  from Apl_feedbackdoc s where  s.id in (:ids) ")
   void removeByIds(@Param("ids") List<Integer> ids);


   /**
    * 通过applyid查询对应的处理反馈材料
    * @param applyid
    */
   @Query(" from Apl_feedbackdoc s where s.applyid = :applyid")
   List<Apl_feedbackdoc> queryFeedBackDocList(@Param("applyid") String applyid);
}
